<?php
/**
 * Interface for keyphrase classes
 *
 * Copyright (C) 2008  Sean Hickey
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Sean Hickey <sean@headzoo.com>
 * @version $Id: Interface.php 380 2008-07-03 05:28:20Z sean $
 * @package Alinks_Keyphrase
 */
interface Alinks_Keyphrase_Interface
{
	/**
	 * Sets the keyphrase data from an array
	 *
	 * @param array $data The keyphrase data
	 * @return Alinks_Keyphrase_Interface
	 */
	function setData(array $data);
	
	/**
	 * Returns the phrase
	 *
	 * @return string
	 */
	function getPhrase();
	
	/**
	 * Returns the description
	 *
	 * @return string
	 */
	function getDescription();
	
	/**
	 * Returns the options
	 *
	 * If $key is specified, then the value for that option will be
	 * returned. Otherwise an array of all the options will be
	 * returned.
	 *
	 * @param string $key The option key
	 * @return array
	 */
	function getOptions($key = null);
	
	/**
	 * Returns the safe name of the factory that created the keyphrase
	 *
	 * @return string
	 */
	function getFactory();
	
	/**
	 * Returns the date the keyphrase was created as a unix timestamp
	 *
	 * @return int
	 */
	function getCreated();
	
	/**
	 * Returns the hash
	 *
	 * @return string
	 */
	function getHash();
	
	/**
	 * Sets the phrase
	 *
	 * @param string $phrase The phrase
	 * @return Alinks_Keyphrase_Interface
	 */
	function setPhrase($phrase);
	
	/**
	 * Sets the description
	 *
	 * @param string $description The description
	 * @return Alinks_Keyphrase_Interface
	 */
	function setDescription($description);
	
	/**
	 * Sets the options
	 *
	 * @param array $options The options
	 * @return Alinks_Keyphrase_Interface
	 */
	function setOptions(array $options);
	
	/**
	 * Adds an option
	 *
	 * @param string $key Option key
	 * @param string $value Option value
	 * @return Alinks_Keyphrase_Abstract
	 */
	function addOption($key, $value);
	
	/**
	 * Sets the safe name of the factory that created the keyphrase
	 *
	 * @param string $factory The factory safe name
	 * @return Alinks_Keyphrase_Interface
	 */
	function setFactory($factory);
	
	/**
	 * Sets the date the keyphrase was created
	 *
	 * @param string|int $created The date the keyphrase was created
	 * @return Alinks_Keyphrase_Interface
	 */
	function setCreated($created);
	
	/**
	 * Sets the hash
	 *
	 * @param string $hash The hash
	 * @return Alinks_Keyphrase_Interface
	 */
	function setHash($hash);
	
	/**
	 * Returns the keyphrase data as an array
	 *
	 * @return array
	 */
	function toArray();
	
	/**
	 * Returns the keyphrase data as a stdClass instance
	 *
	 * @return stdClass
	 */
	function toStdClass();
}